//
//  WKDownLoadManger.h
//  WeKeTang
//
//  Created by ichina on 2017/9/21.
//  Copyright © 2017年 Dezhi Tiancheng Education Technology (Beijing) Co. Ltd. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking.h>

typedef void (^completeBlock)(NSURLResponse * _Nullable response,  NSString * _Nullable filePath);

typedef void (^errorBlock)(NSError * _Nonnull error);

typedef void (^progressBlock)(NSProgress * _Nonnull prograss);



@interface WKDownLoadManger : NSObject

@property (nonatomic,copy)completeBlock _Nullable  completeBlock;

@property (nonatomic,copy)errorBlock _Nullable  errorBlock;

@property (nonatomic,copy)progressBlock _Nullable  progressBlock;

@property (nonatomic, strong) NSMutableDictionary * _Nullable tasks;

+ (instancetype _Nullable )defaultInstance;
#pragma mark - 下载
- (void)downloadFileWithUrl:(NSString *_Nullable)url
            progressHandler:(progressBlock _Nullable )progressBlock
            completeHandler:(completeBlock _Nullable )completeBlock
              errorHandlerk:(errorBlock _Nullable )errorBlock;
#pragma mark - 暂停下载
- (void)suspendDownLoad;
- (void)suspendDownLoadWithUrl:(NSString*_Nullable)url;

@end
